import { CHANGELOADING } from '../constant.js'

const initState = {loading: false}

export default function LoadingReducer(preState=initState, action) {
	const {type, data} = action
	switch (type) {
		case CHANGELOADING:
			let newState = {...preState}
			newState.loading = data
			return newState
		default: 
			return preState
	}
}